1. Field of the Invention
The present invention relates to an apparatus and a method for controlling a motor, capable of efficiently controlling a motor by detecting a position of a rotor with a required resolution and reducing an error at the time of detecting a position of a rotor, by sampling a first signal generated in pulse form from an output of a position sensor such as a hall sensor, or the like, generating a section counter value and an error value by dividing a sampled frequency with the required resolution, and reflecting the generated section counter value and error value in a first signal sampling of a subsequent period, in detecting the position of the rotor.
2. Description of the Related Art
Generally, a brushless direct contact (BLDC) motor may be controlled with a pulse width modulation (PWM) signal. In an apparatus for controlling a motor based on an analog circuit, a delay time, and the like, is determined by external devices, and therefore may have a fixed value, independent of a speed of a motor, but the number of devices may be increased further than that of a digital circuit. Therefore, a need exists for technology able to accurately detect a speed and a current position of a rotor while replacing an analog circuit with a digital circuit.
In the related art, when a position of a rotor is detected using a hall sensor, or the like, a method of converting a signal output from the hall sensor into a signal having a pulse form and sampling a pulse signal within one period in which a value of a pulse signal is changed from a low level to a high level or from a high level to low level has been used. For example, when a total of N-time sampled frequency is generated within a period immediately prior to the pulse signal, the position of the rotor may be detected under the assumption that the same N-time sampled frequency also appears in a current period.
In this case, the resolution of detecting the speed, the position, and the like of the rotor within one period of the pulse signal is determined according to a period of the pulse signal and a period of a signal in which the pulse signal is sampled. Therefore, in the case that any value is selected as the resolution, an accurate position may not be detected with a required resolution when the frequency sampled within one period of the pulse signal is not a multiple of resolution.
The Related Art Document below relates to an RTC frequency compensation circuit included in a mobile communications terminal and discloses contents of counting a low frequency clock signal with a high frequency clock signal and compensating for a counter value of the low frequency clock signal by computing an error value when an error occurs. However, the Related Art Document does not disclose contents of detecting a position of a rotor by comparing an error value computed in an immediately prior period and a counter value of an immediately prior period with a counter value of a current period when the required detection resolution is applied.
[Related Art Document]
Korean Patent Laid-Open Publication No. 10-2007-0071671